﻿Public Class FindForm
    '
    Public Delegate Sub FindTextEvent(ByVal strFindText As String, ByVal itype As Integer)
    Public FindTextEventForm As FindTextEvent

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.Close()
    End Sub

    Public Overridable Function CheckFindEvent() As Boolean
        Return True
    End Function

    Public Overridable Sub Find()
        If Not CheckFindEvent() Then
            Return
        End If
    End Sub

    Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click
        Find()
    End Sub

    Public Overridable ReadOnly Property FirstControl() As System.Windows.Forms.Control
        Get
            Return Nothing
        End Get
    End Property

    Private Sub FindForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If FirstControl IsNot Nothing Then
            FirstControl.Focus()
        End If
    End Sub

End Class
